import React, { Component } from 'react'

export default class App extends Component {
    state = {
        mytext : '收藏',
        isShow : true
    }
  render() {
    return (
      <div>
        <h1>Hello React</h1>
        <button onClick={ ()=>{
            this.setState({
                isShow : !this.state.isShow
            })
            if(this.state.isShow){
                console.log('收藏后的后续操作');
            }else{
                console.log('取消收藏后的后续操作');
            }
        } }>{ this.state.isShow?'收藏':'取消收藏' }</button>
      </div>
    )
  }
}
